package cn.ichiva.common;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 线程传参数
 */
public class ThreadContent {
    private static final ThreadLocal<Map<String,Object>> context = ThreadLocal.withInitial(HashMap::new);
    public static Object get(String key){
        return context.get().get(key);
    }

    public static void put(String key,Object val){
        context.get().put(key,val);
    }

    public static void clear() {
        context.get().clear();
    }
}
